package com.heima.feign.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dtos.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author jack
 * @data 2024 16:04
 */
@FeignClient("leadnews-schedule")
public interface IScheduleClient {
    /**
     * 添加任务
     *
     * @param taskDto
     */
    @PostMapping("/api/v1/schedule/addTask")
    void addTask(@RequestBody TaskDto taskDto);

    /**
     * 拉取任务
     *
     * @param taskType 任务类型
     * @param priority 任务优先级
     * @return
     */
    @PostMapping("/api/v1/schedule/pullTask/{taskType}/{priority}")
    ResponseResult pullTask(@PathVariable Integer taskType,
                            @PathVariable Integer priority);
}
